<template>
  <div>
    <h2>HOME</h2>
    <div>
      <router-link to="/home/news">news</router-link>
      <!-- <router-link to="/home/music/1/4min">华语music</router-link>
      <router-link to="/home/music/2/5min">粤语music</router-link>
      <router-link to="/home/music/3/2min">英语music</router-link> -->

      <!-- 
        注意事项:
          - to的对象写法中,如果和params一起使用,则不能书写path,只能使用name
          - 可选的params参数,要么不写,要么写一个undefined做为值,不能书写一个空字符串
       -->
      <router-link
        :to="{
          name: 'music',
          params: {
            id: '1',
            //time: '',
            time: undefined,
          },
        }"
        >华语music</router-link
      >

      <router-link
        :to="{
          name: 'music',
          params: {
            id: '2',
            time: undefined,
          },
        }"
        >粤语music</router-link
      >

      <router-link
        :to="{
          name: 'music',
          params: {
            id: '3',
          },
        }"
        >英语music</router-link
      >

      <router-link
        :to="{
          path: '/home/games',
          //name: 'games',
          query: {
            tit: '暴力摩托',
            version: '2007',
          },
        }"
      >
        游戏1
      </router-link>

      <router-link to="/home/games?tit=qq飞车&version=2018">
        游戏2
      </router-link>
    </div>

    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "Home",
};
</script>

<style>
</style>